﻿using MyCode.Project.Domain.Businesses.FileManager;
using MyCode.Project.Domain.Message.Response.ServiceOrder;
using MyCode.Project.Domain.Message.Response.Shop;
using MyCode.Project.Domain.Model;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.Infrastructure.Enumeration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCode.Project.Domain.Message.Response.User
{
    #region 会员消费订单记录
    public class MemberOrderListResp
    {
        /// <summary>
        /// 总额
        /// </summary>
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// 服务总数
        /// </summary>
        public int ServiceAmount { get; set; }

        /// <summary>
        /// 订单明细列表
        /// </summary>
        public PageResult<MemberOrderList> OrderList { get; set; }
    }

    public class MemberOrderList
    {
        /// <summary>
        /// 消费主键ID(后台逻辑需要)
        /// </summary>
        public Guid ID { get; set; }

        /// <summary>
        /// 退换货主键ID(后台逻辑需要)
        /// </summary>
        public Guid? RefSalesSheetID { get; set; }

        /// <summary>
        /// 消费类型 0：销售  1：退换货  20：预售  30：充值 40：服务单
        /// </summary>
        public int SalesType { get; set; }      

        /// <summary>
        /// 消费类型文本
        /// </summary>
        public string SalesTypeStr { get; set; } 

        /// <summary>
        /// 退款状态  0：显示退款按钮 1：不显示退款按钮
        /// </summary>
        public int HasReturn { get; set; }

        /// <summary>
        /// 退款状态文本  
        /// </summary>
        public string HasReturnStr { get; set; }

        /// <summary>
        /// 业务单号
        /// </summary>
        public string Sheet { get; set; }

        /// <summary>
        /// 会员id
        /// </summary>
        public Guid MemberId { get; set; }

        /// <summary>
        /// 会员名称
        /// </summary>
        public string MemberName { get; set; }

        /// <summary>
        /// 加盟商id
        /// </summary>
        public Guid CustomerId { get; set; }

        /// <summary>
        /// 店铺名称
        /// </summary>
        public string ShopName { get; set; }

        /// <summary>
        /// 接待人
        /// </summary>
        public string ClerkName { get; set; }

        /// <summary>
        /// 操作数量
        /// </summary>
        public int TotalQty { get; set; }

        /// <summary>
        /// 支付方式文本
        /// </summary>
        public string PayTypeStr { get; set; }

        /// <summary>
        /// 实际支付金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }


        /// <summary>
        /// 备注
        /// </summary>
        public string Note { get; set; }

        /// <summary>
        /// 订单明细列表
        /// </summary>
        public List<MemberOrderDetail> DetailList { get; set; }

        /// <summary>
        /// 赠送的服务列表
        /// </summary>
        public List<GiveAwayDetail> GiveAwayList { get; set; }

    }
    #endregion

    #region 会员消费订单记录明细
    public class MemberOrderDetail
    {
        /// <summary>
        /// 明细主键ID
        /// </summary>
        public Guid? Id { get; set; }
        /// <summary>
        /// 明细商品ID
        /// </summary>
        public Guid? ItemId { get; set; }

        /// <summary>
        /// 消费类型 0：销售  1：退换货  20：预售  30：充值 40：服务单
        /// </summary>
        public int SalesType { get; set; }

        /// <summary>
        /// 商品类型 (2,3,4 需要有展开明细)   0：商品 1：服务 2：套餐 3：卡套 4：自定义套餐 
        /// </summary>
        public int ItemType { get; set; }

        /// <summary>
        /// 剩余服务次数
        /// </summary>
        public int LeftServiceQty { get; set; }

        /// <summary>
        /// 是否显示核销
        /// </summary>
        public bool ShowVerification { get; set; }

        /// <summary>
        /// 主图文件
        /// </summary>
        public FileUse Img { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string GoodsName { get; set; }

        /// <summary>
        /// 购买数量
        /// </summary>           
        public int Qty { get; set; }

        /// <summary>
        /// 商品价格（分摊价）或 充值类型(实付金额)
        /// </summary>           
        public decimal Price { get; set; }

        /// <summary>
        /// (充值金额)
        /// </summary>           
        public decimal AccPrice { get; set; }

        /// <summary>
        /// 商品编码
        /// </summary>
        public string CustomBC { get; set; }
    }

    public class MemberOrderItem
    {
        /// <summary>
        /// 订单明细
        /// </summary>
        public Guid ID { get; set; }

        /// <summary>
        /// 订单明细主键ID
        /// </summary>
        public Guid DetailID { get; set; } 
        
        /// <summary>
        /// 商品名称
        /// </summary>
        public string GoodsName { get; set; }

        /// <summary>
        /// 购买数量
        /// </summary>           
        public int Qty { get; set; }

        /// <summary>
        /// 商品价格（分摊价）或 充值类型(实付金额)
        /// </summary>           
        public decimal Price { get; set; }

        /// <summary>
        /// (充值金额)
        /// </summary>           
        public decimal AccPrice { get; set; }

        /// <summary>
        /// 订单类型
        /// </summary>           
        public int SalesType { get; set; }

        /// <summary>
        /// 商品ID
        /// </summary>
        public Guid GoodsID { get; set; }

        /// <summary>
        /// 商品类型 0：商品 1：服务 2：套餐 3：卡套 4：自定义套餐 20：预售 30：充值 40：服务
        /// </summary>
        public int ItemType{ get; set; }

        /// <summary>
        /// 商品编码
        /// </summary>
        public string CustomBC { get; set; }
    }

    public class ItemDetailOfDetail
    {

        /// <summary>
        /// 主键ID
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        public Guid? SheetId { get; set; }

        /// <summary>
        /// 明细商品ID
        /// </summary>
        public Guid? ItemId { get; set; }

        /// <summary>
        /// 购买数量
        /// </summary>           
        public int Qty { get; set; }

        /// <summary>
        /// 主图文件
        /// </summary>
        public FileUse Img { get; set; }


        /// <summary>
        /// 商品编码
        /// </summary>
        public string CustomBC { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string GoodsName { get; set; }

        /// <summary>
        /// 商品类型 0：商品 1：服务 2：套餐 3：卡套 4：自定义套餐 20：预售 30：充值 40：服务
        /// </summary>
        public int ItemType { get; set; }


    }


    public class GiveAwayDetail
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        public Guid? SheetId { get; set; }

        /// <summary>
        /// 明细商品ID
        /// </summary>
        public Guid? ItemId { get; set; }

        /// <summary>
        /// 购买数量
        /// </summary>           
        public int Qty { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string GoodsName { get; set; }

        /// <summary>
        /// 项目类型。0=商品；1=服务；2=套餐,3=卡券 , 4=自定义套餐
        /// </summary>
        public int ItemType { get; set; }

        /// <summary>
        /// 主图文件
        /// </summary>
        public FileUse Img { get; set; }


        /// <summary>
        /// 剩余服务次数
        /// </summary>
        public int LeftServiceQty { get; set; }

        /// <summary>
        /// 是否显示核销
        /// </summary>
        public bool ShowVerification { get; set; }
    }

    public class ServiceNameDetail
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 明细商品ID
        /// </summary>
        public Guid? ItemId { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 项目类型。0=商品；1=服务；2=套餐,3=卡券 , 4=自定义套餐
        /// </summary>
        public int ItemType { get; set; }
     
    }


    #endregion
}
